//
//  NSString+MenkHeigh.m
//  计算文字占据多少Label
//
//  Created by Burn on 2019/5/9.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import "NSString+MenkHeigh.h"

@implementation NSString (MenkHeigh)

//  使用首行和换行模式 需要添加  NSStringDrawingUsesFontLeading  (NSKernAttributeName:@1.5f == 每个字之间的间距 蒙文禁止使用)
- (CGFloat )labelWidth:(CGFloat )w attributes:(NSDictionary *)dict{
     CGSize size = [self boundingRectWithSize:CGSizeMake(w,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dict context:nil].size;
    return size.height;
}
@end
